package days48;

import java.util.Scanner;

public class Day26 {
    static  long b=0;
    static long a=0;
    public static void main(String[] args) {
        long start=System.currentTimeMillis();
//        Scanner scanner=new Scanner(System.in);
//        while (scanner.hasNextLine()) {
//            String str=scanner.nextLine();
//            String[] s=str.split(" ");
//            String str1=s[0];
//            String str2=s[1];
//            for (int i = 0; i < str2.length()&&i<str1.length(); i++) {
//                if(str1.length()<str2.length()){
//                    System.out.println("yes");
//                }
//                if(str1.length()>str2.length()+1){
//                    System.out.println("no");
//                }
//                double a=str1.charAt(i)-'0';
//                double b=str2.charAt(i)-'0';
//                b=2*3.14*b;
//                if(b>a){
//                    System.out.println("yes");
//                }else if(b<a){
//                    System.out.println("no");
//                }else {
//                    continue;
//                }
//            }
//        }
        Thread thread1=new Thread(new Runnable() {
            @Override
            public void run() {
                for (long i = 0; i < 10000000; i+=2) {
                    a+=i;
                }
            }
        });

        Thread thread2=new Thread(new Runnable() {
            @Override
            public void run() {
                for (long i = 1; i < 10000000; i+=2) {
                    b+=i;
                }
            }
        });
        thread1.start();
        thread2.start();
        try {
            thread1.join();
            thread2.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(a+b);
        long endTime=System.currentTimeMillis();
        System.out.println(endTime-start+"ms");
    }
}
